/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Filter;

import Proxy.FileInterface;
import Proxy.MyFile;
import java.util.ArrayList;

/**
 *
 * @author Andreea
 */
public class NameFilter extends Filter{
    public ArrayList<FileInterface> getData(ArrayList<FileInterface> files, String key){
        for (FileInterface f:files){
            MyFile file=(MyFile) f;
            if (!file.getName().contains(key)) 
                files.remove(file);
        }
        return files; 
    }

    @Override
    public ArrayList<FileInterface> getAfterSize(ArrayList<FileInterface> files, int min, int max) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
